<?php $this->load->view('admin/header');?>

    <div class="main clear">
    <?php if($op =='list'):?>
    <div class="tool">

        <a href="/index.php?d=admin&c=tag&m=edit">添加标签</a>
        <a href="javascript:create_all()">全部生成</a>
        <a href="/index.php?d=admin&c=tag/">全部列表</a>

        <form id="search_tag" style="display:inline; margin-left:20px;" method="get" action="/index.php?d=admin&c=tag">
            <input id="tagname" name="tagname" type="text" class="txt" value="<?php if(isset($tagname)){echo $tagname;}else{echo '请输入查询关键字';}?>" onblur="if (this.value == '') this.value = '请输入查询关键字'" onfocus="if (this.value == '请输入查询关键字') this.value = '';" name="keyword" style="width: 180px;">
            <a href="javascript:search_tag()">搜索</a>

        </form>
        <script type="text/javascript">
            function search_tag() {
                $('#search_tag').submit();
            }
        </script>
    </div>
    <style type="text/css">
        .bdrcontent {
            padding: 1em;
        }
        .bdrcontent li {
            border-bottom: 1px solid #eeeeee;
            line-height: 38px;
        }
        .a {
            width: 5%;
        }
        .b {
            width: 11%;
        }
        .c {
            width: 22%;
        }
        .d {
            width: 11%;
        }
        .b, .c, .a, .d {
            float: left;
        }
    </style>
    <ul class="bdrcontent" style="overflow:hidden;">
    <li class="a">&nbsp</li>
    <li class="d">标签名</li>

    <li class="b">点击量</li>
    <li class="c">操作</li>
    <li class="a">&nbsp</li>
    <li class="d">标签名</li>

    <li class="b">点击量</li>
    <li class="c">操作</li>
    <?php if(!empty($list)){foreach($list as $v){?>
        <li class="a">&nbsp;</li>
        <li class="d"><a href="<?php echo $tag_url.$v['id'];?>.html" target="_blank"><?php echo $v['tagname'];?></a></li>

        <li class="b"><?php echo $tag_url.$v['click'];?></li>
        <li class="c">
            <a href="<?php echo $tag_url.$v['id'];?>.html">预览</a>&nbsp;|
            <a href="/index.php?d=admin&c=tag&m=edit&id=<?php echo $v['id'];?>/">修改</a>&nbsp;|
            <a href="">生成</a>&nbsp;|&nbsp;
            <a href="/index.php?d=admin&c=article_list&m=index&tag=<?php echo $v['tagname'];?>" >内容</a>&nbsp;|&nbsp;
            <a href="/index.php?d=admin&c=tag&m=del&id=<?php echo $v['id'];?>">删除</a>
        </li>
    <?php }}else{?>
        <li class="a">&nbsp;</li>
        <li class="d">暂无数据</li>
        <li class="b">&nbsp;</li>
        <li class="c">&nbsp;</li>
     <?php }?>

    </ul>
    <?php else:?>
    <div class="table02">
        <form id="tag_form" method="post" action="/index.php?d=admin&c=tag&m=save">
            <div class="add_item" style="margin-top: 10px;">
                <label>标签名：</label>
                <input id="tagname" class="txt width500" type="text" value="<?php if(isset($info['tagname'])){echo $info['tagname'];}?>" name="tagname">
            </div>
            <div class="add_item" style="margin-top: 10px;">
                <label>标签title：</label>
                <input id="title" class="txt width500" type="text" value="<?php if(isset($info['title'])){echo $info['title'];}?>" name="title">
            </div>
            <div class="add_item" style="margin-top: 10px;">
                <label>标签关键字：</label>
                <input id="keywords" class="txt width500" type="text" value="<?php if(isset($info['keywords'])){echo $info['keywords'];}?>" name="keywords">
            </div>
            <div class="add_item" style="margin-top: 10px;">
                <label>标签描述：</label>
                <input id="description" class="txt width500" type="text" value="<?php if(isset($info['description'])){echo $info['description'];}?>" name="description">
            </div>
            <div class="btn_box" style=" text-align: left;">
                <input type="hidden" name="id" value="<?php if(isset($info['id'])){echo $info['id'];}?>">
                <input type="submit" value="保存" name="">
                <input type="button" onclick="fanhui()" value="返回" name="">
            </div>
        </form>
    </div>

    <script type="text/javascript">
        function fanhui(){
            $('#tag_form').submit();
        }
    </script>
    <?php endif;?>
    </div>
<?php $this->load->view('admin/footer');?>